/**
 * Created by Administrator on 16-2-22.
 */
/**
 * Created by cxj on 2016/2/2.
 */
define([
    "jquery",
    "IO",
    "bootbox"
], function($,IO,bootbox) {
    $(document).on("click",".publish",function(){

        var cate_name=$("#cate_name").val();

        var param={cate_name:cate_name};


        if(cate_name==""){
            alert("请输入分类名称");
            return;
        }
        if(param&&param!='undefined'){
            bootbox.confirm("确定要添加该课程",function(result){
                if(result) {
                    IO.post("api/add_fenlei",param,function(d){
                        bootbox.alert(d.msg,function(){
                            if (d.code == 0) {
                                location.href = '/pte/inform_fenlei';
                            }
                        })
                    });
                }
            });
        }

    });


});